<?php session_start();
	require_once '../lib/sql.php';
	new Sql();
	
	$uname= $_REQUEST['uname'];
	$pass= $_REQUEST['pass'];
	
	$rs = @mysql_query("select * from user where username= '$uname' and password='$pass'");
	if($record=@mysql_fetch_array($rs)){
		$_SESSION['uname']=$record['name'];		
		$_SESSION['sex']=$record['sex'];		
		header("Location: ../index.php");
	}else{
		header("Location: ../waiting.php");
	}
	